package com.kun.enums;

import lombok.Getter;

/**
 * 数据权限枚举类
 *
 * @author kun.li
 */
@Getter
public enum DataScopeEnums {
    ALL(0, "全部"),
    DEPT(1, "本部门"),
    DEPT_CHILDREN(2, "本部门及以下"),
    CUSTOM(3, "自定义"),
    SELF(4, "仅本人"),
    ;


    private final Integer dataScopeType;

    private final String describe;

    DataScopeEnums(Integer dataScopeType, String describe) {
        this.dataScopeType = dataScopeType;
        this.describe = describe;
    }

    public static boolean isDataScope(Integer dataScopeType) {
        for (DataScopeEnums dataScope : DataScopeEnums.values()) {
            if (dataScope.getDataScopeType().equals(dataScopeType)) {
                return true;
            }
        }
        return false;
    }


}
